<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript">
	$(document).ready(function(){
		$("#listBtn").click(function(){
			if(confirm("문의글 목록으로 돌아 가시겠습니까?")){
				location.href="getQuestionBoardList.do?pageNo=${requestScope.pageNo}";
			}else{
				return;
			}
		});
		$("#updateBtn").click(function(){
			if($("#title").val()==""){
				alert("제목을 입력해 주세요!");
				return;
			}else if($("#content").val()==""){
				alert("내용을 입력해 주세요!");
				return;
			}else{
				$("#updateForm").submit();
			}
		});
	});
</script>

<form id="updateForm" action="updateQuestionBoard.do" method="post" >
	<table width="450">
		<thead align="left">
		<tr>
			<td width="15%">작성자</td>
			<td width="60%">${requestScope.qvo.id }</td>
			<td width="15%">조회수</td>
			<td>${requestScope.qvo.count }</td>
		</tr>
		<tr>
			<td width="15%">날짜</td>
			<td width="60%">${requestScope.qvo.questionDate}</td>
			<td width="15%">글번호</td>
			<td>${requestScope.qvo.no }</td>
		</tr>
		<tr>
			<td width="15%">제목</td>
			<td colspan="3" width="85%">
				<input type="text" name="title" id="title" value="${requestScope.qvo.title}">
			</td>
		</tr>
		</thead>
		<tbody align="left">
		<tr>
			<td colspan="4" align="center">
				<textarea cols="52" rows="10" name="content" id="content">${requestScope.qvo.content }</textarea>
			</td>
		</tr>
		</tbody>
		<tfoot align="left">
		<tr>
			<td colspan="4">
				<input type="button" id=listBtn value="목록 보기">
				<input type="button" id="updateBtn" value="수정 하기">
				<input type="reset" value="복원 하기">
			</td>
		</tr>
		</tfoot>
	</table>
	<input type="hidden" name="no" value="${requestScope.qvo.no }">
	<input type="hidden" name="pageNo" value="${requestScope.pageNo}">
</form>
